package com.mingtai.design.pattern.behavioralming.chainofresponsibility;

import org.apache.commons.lang3.StringUtils;

/**
 * @description:
 * @author: mingtai
 * @createDate: 23:17 2021/1/7
 * @version: 1.0
 */

public class VideoApprove extends Approver {

    @Override
    public void deploy(Course course) {
        if (StringUtils.isNotEmpty(course.getVideo())) {
            System.out.println(course.getName() + "视频审批通过");
            // 拿到父类的approver，判断父类的approver是否为空
            if (approver != null) {
                // 不为空的话就继续往下走,交给下一个审批者审批(校验)
                approver.deploy(course);
            }
        } else {
            System.out.println(course.getName() + "视频审批不通过，不能继续下一步审批，流程结束");
            return;
        }
    }
}



